
import java.io.*;

public class IO {
    public static void main(String[] args) {
        FileReader freader = null;
        FileWriter fwriter = null;
        BufferedReader bf = null;
        try {
            freader = new FileReader("Q1_data.txt");
            fwriter = new FileWriter("diff.txt");
            bf = new BufferedReader(freader);
            StringBuffer fal = new StringBuffer();
            StringBuffer reg = new StringBuffer();
            char c;
            String line = new String();
            while (true) {
                c = (char) freader.read();
                if (c == '\t') {
                    break;
                }
                fal.append(c);
            }
            while (true) {
                c = (char) freader.read();
                if (c == '\n') {
                    break;
                }
                reg.append(c);
            }
            while ((line = bf.readLine()) != null) {
                System.out.println(line);
                reg = new StringBuffer();
                fal = new StringBuffer();
                int i = 0;
                while (true) {
                    c = line.charAt(i);
                    if (c == '\t') {
                        i++;
                        break;
                    }
                    fal.append(c);
                    i++;
                }
                while (true) {
                    if (i >= line.length())
                        break;
                    c = line.charAt(i);
                    if (c == '\n') {
                        break;
                    }
                    reg.append(c);
                    i++;
                }
                StringBuffer falset = new StringBuffer();
                StringBuffer regset = new StringBuffer();
                for (int it = 0; it < reg.length() && it < fal.length(); it++) {
                    if (fal.charAt(it) != reg.charAt(it)) {
                        falset.append(fal.charAt(it));
                        regset.append(reg.charAt(it));
                    }
                }
                System.out.println(falset + " " + regset);
                fwriter.write(falset + " " + regset + "\n");
            }
        } catch (Exception e) {
            ;
        } finally {
            try {
                if (freader != null)
                    freader.close();
                fwriter.close();
                bf.close();
            } catch (Exception e) {
                ;
            }
        }
    }
}